package com.matrix.java.chap_06;

/*
    一年的天数
 */
public class Ex6_16 {
    public static void main(String[] args) {
        for (int i = 2000; i <= 2020; i++) {
            System.out.println(i + "\t" + numberOfDaysInAYear(i));
        }
    }

    private static int numberOfDaysInAYear(int year) {
        int yearDays;
        if (year % 400 == 0) {
            yearDays = 366;
        } else if (year % 4 == 0) {
            yearDays = 366;
        } else {
            yearDays = 365;
        }
        return yearDays;
    }
}
